package com.zoweunion.mechanic.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.zoweunion.mechanic.entity.DeptEntity;
import com.zoweunion.mechanic.util.MyException;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 部门表(新)
 *
 * @author xp
 * @email 17688825585@163.com
 * @date 2020-09-24 14:57:06
 */
public interface DeptService extends IService<DeptEntity>{

    List<DeptEntity> queryPage(Map<String, Object> map);

    List<Map<String,Object>> serverList(Map<String, Object> params);

    void insertUser(DeptEntity params) throws MyException;

    /**
     * 添加用户与部门的关联信息
     * @param params
     */
    void insertRelation(DeptEntity params);

    /**
     * 更新用户与部门的关联
     * @param params
     * @return
     */
    int updateUserRelation(DeptEntity params);

    PageInfo<Map<String, Object>> userList(Map<String, Object> params);

    void updateUser(DeptEntity params);

    void deleteUser(DeptEntity params);

    void deleteDept(Map<String, Object> params);

    void deleteParent(long id);

    void insertUpdateServer(DeptEntity params);

    List<Map<String,Object>> selectServer(@RequestParam Map<String, Object>  params);

    /**
     * 根据userId获取已设置的服务商列表
     * @param params
     * @return
     */
    List<Map<String, Object>> getManagedServerList(Map<String, Object> params);
}

